#include "precomp.h"

#pragma once

#define DEFAULT_FONT L"Tahoma"

class HUD_Object{
public:
	HUD_Object(){}

	HUD_Object(CL_GraphicContext *gc);

	~HUD_Object();
	
	void set_image(const char* image_dir, CL_Pointf position);

	void change_image(const char* image_dir);

	void set_font(CL_String text, int font_size, CL_Pointf position, CL_Color color = CL_Colord::red, const wchar_t* font_type = DEFAULT_FONT);

	void change_text(CL_String text);

	void draw(CL_GraphicContext *gc = NULL);

	void draw(CL_Pointf p, CL_GraphicContext *gc = NULL);

	void draw(float x, float y, CL_GraphicContext *gc = NULL);

	void add(HUD_Object *object);

	inline float get_x(){ return _x;}
	inline float get_y(){ return _y;}

	void set_position(float x, float y){ 
		_x = x; 
		_y = y; 
	}

protected:
	float _x, _y;

	vector<HUD_Object*> _objects;

	CL_Image* _image;
	CL_Pointf _image_position;

	CL_Font* _font;
	CL_Pointf _font_position;
	CL_String _font_text;
	CL_Color _font_color;

	CL_GraphicContext *_gc;
};